﻿using System.Windows;
using WP7FlacPlayer.ViewModel;

namespace WP7FlacPlayer.View
{
    public partial class MainPage
    {
        // 构造函数
        public MainPage()
        {
            InitializeComponent();
            ((MainPageViewModel) DataContext).PlayListBox = PlayList;
            ((MainPageViewModel)DataContext).ControlPanel = ControlPanel;
        }

        private void SkyDriveClick(object sender, System.EventArgs e)
        {
            NavigationService.Navigate("/View/SkyDrivePage.xaml");
        }

        protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            base.OnBackKeyPress(e);
            e.Cancel = MessageBox.Show("确定退出程序？", "确认", MessageBoxButton.OKCancel) != MessageBoxResult.OK;
        }

    }
}